package com.clgk.wechatmall.util;

import java.util.HashMap;
import java.util.Map;


public class MessageUtil {
	
	
	/**
	 * 网关上报数据
	 * key:网关ID，val：date-content
	 */
	public static Map<String, String> GATEWAY_UPLOAD_DATA_LAST = new HashMap<String, String>();
	
	
	/**
	 * 发送注册验证码
	 * @param verifyCode  验证码
	 * @param phoneNum	     发送号码
	 * @return true发送成功，false发送失败
	 */
	public static boolean sendRegistVerifyCode(String verifyCode,String phoneNum){
		/*try {
			TaobaoClient client = new DefaultTaobaoClient(PropertyUtil.getProperty("Message_url"), PropertyUtil.getProperty("Message_appkey"),PropertyUtil.getProperty("Message_secret"));
			AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
			req.setExtend("0000000");
			req.setSmsType("normal");
			req.setSmsFreeSignName("注册验证");
			req.setSmsParamString("{\"codes\":'"+verifyCode+"'}");
			req.setRecNum(phoneNum);
			req.setSmsTemplateCode("SMS_77305058");
			AlibabaAliqinFcSmsNumSendResponse rsp = client.execute(req);
			String repStr = rsp.getBody();
			System.out.println(repStr);
			JSONObject repObject = (JSONObject) JSONObject.parse(repStr);
			JSONObject rep = (JSONObject)repObject.get("alibaba_aliqin_fc_sms_num_send_response");
			JSONObject errRep = (JSONObject)repObject.get("error_response");
			System.out.println(errRep);
			if(rep != null){
				JSONObject d = (JSONObject)rep.get("result");
				boolean result = d.getBoolean("success");
				return result;
			}else if(errRep != null){
				return false;
			}
		} catch (ApiException e) {
			e.printStackTrace();
		} catch (Exception e){
			e.printStackTrace();
		}*/
		return false;
	}
	public static void main(String[] args) {
		sendRegistVerifyCode("1990", "15017905457");
	}
}
